// HSS.Security.Cryptography.Certificates.TrustAllPolicy.cs
// ----------------------------------------------------------------------------
// Licensed under the MIT license
// http://www.opensource.org/licenses/mit-license.html
// ----------------------------------------------------------------------------
// HighSpeed-Solutions, LLC
// Copyright (c) 2001-2010
// ----------------------------------------------------------------------------
// File:       TrustAllPolicy.cs
// Author:     HSS\gbanta
// Created:    08/12/2010
// Modified:   12/04/2010
// ----------------------------------------------------------------------------
namespace HSS.Security.Cryptography.Certificates
{
	#region Using Directives
	using System.Security.Cryptography.X509Certificates;

	#endregion

	/// <summary>
	/// Trusts all Certificates regardless of issue. Should be used with caution!
	/// </summary>
	public class TrustAllPolicy : System.Net.ICertificatePolicy
	{
		/// <summary>
		/// Allows trusts for all certificates. USE WITH CAUTION!
		/// </summary>
		/// <param name="srvPoint">The System.Net.ServicePoint that will use the certificate.</param>
		/// <param name="certificate">The certificate to validate.</param>
		/// <param name="request">The request that received the certificate.</param>
		/// <param name="certificateProblem">The problem that was encountered when using the certificate.</param>
		/// <returns>true if the certificate should be honored; otherwise, false.</returns>
		public bool CheckValidationResult(System.Net.ServicePoint srvPoint, X509Certificate certificate, System.Net.WebRequest request, int certificateProblem)
		{
			return true;
		}
	}
}